﻿@using QDT.Core
@using QDT.Core.Experience
@using QDT.Core.Projects
@model QDT.Common.IPagedList<Project>
@{
    int i = 1;
    var expproject = ViewBag.expproject as ExpProject;
}
<style type="text/css">
    .extrabonus
    {
        position: absolute;
        top: -1px;
        right: -1px;
    }
    .font-size17:hover
    {
        text-decoration: underline;
    }
</style>
<!--禧农贷开始-->
@foreach (Project project in Model)
{
    var agency = Html.F().GetAgency(project.Parent.AgencyId);
    <div style="float: left; margin-top: 20px;">
        <div style="box-shadow: 1px 1px 1px 1px #e5e5e5; border-radius: 6px 6px 6px 6px;
            background-color: #ffffff;">
            <div class="project_item1" style="position: relative;">
@*                <div class="extrabonus">*@
@*                    @if (project.RepayTime >= 1 && project.RepayTime <= 5 && project.ID <= 1001)*@
@*                    {*@
@*                        <img src="/Content/Default/Images/extrabonus01.png"*@
@*                            alt="" />*@
@*                    }*@
@*                    else if (project.RepayTime >= 6 && project.RepayTime <= 8 && project.ID <= 1001)*@
@*                    {*@
@*                        <img src="/Content/Default/Images/extrabonus02.png"*@
@*                            alt="" /> *@
@*                    }*@
@*                </div>*@
                <h2>
                    <a href="@Url.Action("Index", "Project", new { id = project.ID })"  class="font-size17" style="color: #ffa024;">@project.Name</a>
                </h2>
                <div style="height: 30px; margin: 10px 0 14px;">
                    <div style="float: left;">
                        <img style="width: 20px; height: 20px;" src="@(agency == null ? Url.Content("/Content/Default/Images/ziyaicon.jpg") : @agency.Logo)" alt=""/></div>
                    @if (agency == null)
                    {
                        <a href="javascript:;" style="line-height: 25px;">&nbsp;&nbsp; <span style="line-height: 25px;"
                            class="font-size12">资产抵押</span> </a>
                    }
                    else
                    {
                        if (agency.ID == 3)
                        {
                            <a href="javascript:;" style="line-height: 25px;">
                                &nbsp;&nbsp; <span style="line-height: 25px;" class="font-size12">@agency.SubName</span>
                            </a>
                        }
                        else
                        {
                            <a href="@Url.Action("GotoAction", "Agency", new { agencyid = project.Parent.AgencyId })" style="line-height: 25px;">
                                &nbsp;&nbsp; <span style="line-height: 25px;" class="font-size12">@agency.SubName</span>
                            </a>
                        }
                    }
                    &nbsp;｜&nbsp; <span class="font-size12" style="line-height: 25px;">付息还本</span>
                </div>
                <div style="height: 22px;">
                    <h3>
                        <span class="font-size15">@(string.IsNullOrWhiteSpace(project.Parent.IndustryDetail) ? "" : project.Parent.IndustryDetail)</span>
                    </h3>
                </div>
                <div>
                    <p style="margin: 10px auto 17px; color: #aaa; line-height: 1.5; height: 55px;" class="font-size12">
                        @(project.Parent.Description.Length > 80 ? project.Parent.Description.Substring(0, 35) : project.Parent.Description)...
                    </p>
                </div>
                <div style="width: 100%; margin-top: 26px; height: 22px;" class="progress_bar">
                    <div style="width: 100%; height: 9px; border-radius: 4px; background-color: #f1f1f1;
                        box-shadow: inset 0 1px 2px #ccc;">
                        <strong class="progress_bgdimg" id="@("progress_" + i)" style="width: @(project.Progress.ToString("0.0") + '%'); background:url(/Content/Default/Images/prograss_bar.png) repeat-x; display: block;  border-radius: 4px;height: 100%;text-align: center;">
                        </strong>
                    </div>
                    <div style="margin-top: 5px;">
                        <span class="font-size14">@project.LoadMoney.ToMoney()</span>&nbsp;<span style="font-size: 18px;">/</span>&nbsp;<span
                            class="font-size14"><em class="time-item">@project.BorrowAmount.ToMoney("F", 10000.00)</em><em
                                class="time-item">&nbsp;万</em></span>
                    </div>
                </div>
                <div style="height: 50px; margin-top: 35px;">
                    <div style="float: left; width: 105px; border-right: 1px solid #e5e5e5">
                        <span style="display: block; margin: 0 15px;"><em style="font-size: 30px; color: #ffa024;
                            line-height: 30px;">@project.Rate</em><em class="font-size16" style="color: #ffa024;">.00%</em></span>
                        <span class="font-size14">预期年化收益率</span>
                    </div>
                    <div style="float: right;">
                        <span style="display: block; margin: 0 5px;"><em style="font-size: 30px; line-height: 30px;">@project.RepayTime</em><em
                            class="font-size14">@(project.RepayTimeType == 0 ? "天" : "个月")</em></span> <span class="font-size14">借款期限</span>
                    </div>
                </div>
            </div>
            @switch (project.Status)
            {
                case ProjectStatus.Full:
                <a href="javascript:;" style="" class="ui-button ui-button-disable project_item1_is font-size16">
                    已满 </a>
                
                    break;
                case ProjectStatus.Repaying:
                <a href="@Url.Action("Index", "Project", new { id = project.ID })" style="" class="ui-button ui-button-progect-gray project_item1_is font-size16">
                    还款中 </a>
                    break;
                case ProjectStatus.Repaid:
                <a href="@Url.Action("Index", "Project", new { id = project.ID })" style="" class="ui-button ui-button-progect-gray project_item1_is font-size16">
                    已还完 </a>
                
                    break;
                case ProjectStatus.Progress:
                <a href="@Url.Action("Index", "Project", new { id = project.ID })" class="ui-button font-size16 @(project.StartTime.Value > DateTime.Now ? "ui-button-red" : "ui-button-orange") project_item1_is">
                    @(project.StartTime.Value > DateTime.Now ? @project.StartTime.Value.ToString("HH:mm") + ' ' + "开售" : "投资")
                </a>
                break;
                case ProjectStatus.Bad:
                <a href="javascript:;" style="" class="ui-button ui-button-green project_item1_is project_item1_is font-size16">
                    流标 </a>
                break;
                case ProjectStatus.Wait:
                <a href="javascript:;" style="" class="ui-button ui-button-green project_item1_is font-size16">
                    等待 </a>
                break;
            }
        </div>
    </div>
    <div style="float: left; width: 22px;">
        &nbsp;</div>
    <script type="text/javascript">
                $("#@("progress_" + i)").ready(function() {
           
                    if (@project.Progress>=100)
                     {
                        $("#@("progress_" + i)").css("background","url(/Content/Default/Images/prograss_bar2.png) repeat-x");
                    }
           
                });
    </script>
                        i++;
}
<!--禧农贷结束-->
